package com.freesky.biz.icbc.controller;

import com.freesky.biz.icbc.domain.TMarketingActivityData;
import com.freesky.biz.icbc.domain.TPartnership;
import com.freesky.biz.icbc.service.IMarketingActivityDataService;
import com.freesky.biz.icbc.service.IPartnershipService;
import com.freesky.common.annotation.Log;
import com.freesky.common.annotation.RepeatSubmit;
import com.freesky.common.core.controller.BaseController;
import com.freesky.common.core.domain.AjaxResult;
import com.freesky.common.core.page.TableDataInfo;
import com.freesky.common.enums.BusinessType;
import com.freesky.common.exception.CustomException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 工行营销日历数据
 */
@RestController
@RequestMapping("/icbc/marketingactivity/data")
public class MarketingActivityDataController extends BaseController {

    @Autowired
    private IMarketingActivityDataService activityDataService;

    @PreAuthorize("@ss.hasPermi('icbc:marketingdata:list')")
    @GetMapping("/list")
    public TableDataInfo list(TMarketingActivityData entity) {
        startPage();
        List<TMarketingActivityData> list = activityDataService.findList(entity);
        return getDataTable(list);
    }

    @Log(title = "营销日历", businessType = BusinessType.EXPORT)
    @PreAuthorize("@ss.hasPermi('icbc:marketingdata:export')")
    @GetMapping("/export")
    public AjaxResult export(TMarketingActivityData entity,
                             HttpServletResponse response) {
        return activityDataService.exportFile(entity);
    }

}
